CREATE TABLE [dbo].[TTDOCU_CORR]
(
[TI_DOCU] [dbo].[TD_VC_003] NOT NULL,
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[ST_GENE_DOCU] [dbo].[TD_VC_001] NOT NULL,
[NU_ULTI_CORR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTDOCU_CO__NU_UL__1699586C] DEFAULT ((0)),
[NU_LINE] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTDOCU_CO__NU_LI__178D7CA5] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTDOCU_CO__CO_US__1881A0DE] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTDOCU_CO__FE_US__1975C517] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTDOCU_CO__CO_US__1A69E950] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTDOCU_CO__FE_US__1B5E0D89] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOCU_CORR] ADD CONSTRAINT [PK__TTDOCU_C__35E42D144AA30C57] PRIMARY KEY CLUSTERED  ([TI_DOCU], [CO_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOCU_CORR] ADD CONSTRAINT [FK__TTDOCU_CO__CO_EM__4F32B74A] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMEMPR] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TTDOCU_CORR] ADD CONSTRAINT [FK__TTDOCU_CO__TI_DO__5026DB83] FOREIGN KEY ([TI_DOCU]) REFERENCES [dbo].[TTDOCU_CNTB] ([TI_DOCU])
GO
GRANT SELECT ON  [dbo].[TTDOCU_CORR] TO [public]
GRANT INSERT ON  [dbo].[TTDOCU_CORR] TO [public]
GRANT DELETE ON  [dbo].[TTDOCU_CORR] TO [public]
GRANT UPDATE ON  [dbo].[TTDOCU_CORR] TO [public]
GO
